<%--
  Created by IntelliJ IDEA.
  User: 20456
  Date: 2021/11/25
  Time: 17:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false" %>
<% String contextPath = request.getContextPath(); %>
<html>
<head>
    <title>全部菜品</title>
    <link rel="stylesheet" type="text/css" href="<%=contextPath%>/bootstrap-3.4.1-dist/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="<%=contextPath%>/css/style.css"/>
    <script src="<%=contextPath%>/js/jquery-3.6.0.min.js"></script>
    <script src="<%=contextPath%>/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
</head>
<body>
<table width="80%" border="1px" cellpadding="0" cellspacing="0">
    <thead>
    <tr>
        <th>序号</th>
        <th>购买者</th>
        <th>订单编号</th>
        <th>订单名称</th>
        <th>订单状态</th>
        <th>创建时间</th>
        <th>关单时间</th>
        <th>支付时间</th>
        <th>完成时间</th>
        <th>购买菜品</th>
        <th>价格</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${orders}" var="order">
        <tr>
            <td>${order.id}</td>
            <td>${order.username}</td>
            <td>${order.ordersn}</td>
            <td>${order.ordername}</td>
            <c:if test="${order.status == '0'}"><td>待付款</td></c:if>
            <c:if test="${order.status == '1'}"><td>待上菜</td></c:if>
            <c:if test="${order.status == '2'}"><td>已完成</td></c:if>
            <c:if test="${order.status == '3'}"><td>超时关单</td></c:if>
            <c:if test="${order.status == '4'}"><td>取消关单</td></c:if>
            <td>${order.createtime}</td>
            <td>${order.closetime}</td>
            <td>${order.paytime}</td>
            <td>${order.successtime}</td>
            <td>${order.foodname}</td>
            <td>${order.price}</td>


            <c:choose>
                <c:when test="${order.status == '0'}">
                    <td style="color: cornflowerblue;">订单待付款</td>
                </c:when>
                <c:when test="${order.status == '1'}">
                    <td style="color: cornflowerblue;"><a target="_self" href="<%=contextPath%>/order/successorder?id=${order.id}">已完成上菜</a></td>
                </c:when>
                <c:otherwise>
                    <td style="color: cornflowerblue;">订单已完成</td>
                </c:otherwise>
            </c:choose>
        </tr>
    </c:forEach>
    </tbody>
</table>
</body>
</html>
